# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Content do
  @moduledoc """
  The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.

  ## Attributes

  *   `parts` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Part.t)`, *default:* `nil`) - Required. Ordered `Parts` that constitute a single message. Parts may have different IANA MIME types.
  *   `role` (*type:* `String.t`, *default:* `nil`) - Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :parts => list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Part.t()) | nil,
          :role => String.t() | nil
        }

  field(:parts, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Part, type: :list)
  field(:role)
end

defimpl Poison.Decoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Content do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Content.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Content do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
